package com.dkd.manage.openai;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

@Configuration
public class DeepseekConfig {

    @Value("${deepseek.api-key}")
    private String apiKey;

    @Bean
    public RestTemplate restTemplate() {
        SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
        factory.setConnectTimeout(500000);
        factory.setReadTimeout(100000);
        return new RestTemplate(factory);
    }

    @Bean
    public String deepseekApiKey() {
        return apiKey;
    }
}
